import psycopg2

conn = psycopg2.connect(database='taobao', user='postgres', password='dch20001121', host='127.0.0.1', port='5432')

cursor = conn.cursor()

sql = "select * from commodity_category"

cursor.execute(sql)

data = cursor.fetchone()

print("总类表目前有数据：", data)

conn.close()